package com.hxzf.mvp.dao.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.hxzf.mvp.commons.domain.BaseEntity;
import com.hxzf.mvp.dao.enums.Gender;
import com.hxzf.mvp.dao.enums.Province;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 用户实体类
 *
 * @author Kai
 * @date 2021/6/21 17:21
 **/
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName(value = "t_user")
public class User extends BaseEntity {

    private String username;

    @TableField(value = "passwd_hash")
    private String password;

    private Gender gender;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday;
    private String tel;
    private String avatar;
    private Province province;
    private String nickname;
    private String email;
    private String address;

    @Version
    private Long version;

    @TableLogic
    @TableField(select = false)
    private Boolean deleted;
}
